package com.the9.C9Alarm;

import android.content.Context;
import android.util.Log;

public class Form {

	private int mainPic;
	private int alarmMusic;
	private int clickSound;

	static Form[] mForm;

	private int titleImg;
	private String titleName;

	public int getClickSound() {
		return clickSound;
	}

	public void setClickSound(int clickSound) {
		this.clickSound = clickSound;
	}

	private int alarmAnim;
	private int backGround;

	public int getBackGround() {
		return backGround;
	}

	public void setBackGround(int backGround) {
		this.backGround = backGround;
	}

	public int getMainPic() {
		return mainPic;
	}

	public void setMainPic(int mainPic) {
		this.mainPic = mainPic;
	}

	public int getAlarmMusic() {
		return alarmMusic;
	}

	public void setAlarmMusic(int alarmMusic) {
		this.alarmMusic = alarmMusic;
	}

	public int getAlarmAnim() {
		return alarmAnim;
	}

	public void setAlarmAnim(int alarmAnim) {
		this.alarmAnim = alarmAnim;
	}

	public static void inialSound(Context c) {
		Media m = Media.getInstance(c);
		m.loadSoundPoolRes(R.raw.beep, R.raw.beep);
	}

	public int getTitleImg() {
		return titleImg;
	}

	public void setTitleImg(int titleImg) {
		this.titleImg = titleImg;
	}

	public String getTitleName() {
		return titleName;
	}

	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}

	public Form(int mainPic, int alarmMusic, int clickSound, int titleImg,
			String titleName, int alarmAnim) {
		super();
		this.mainPic = mainPic;
		this.alarmMusic = alarmMusic;
		this.clickSound = clickSound;
		this.titleImg = titleImg;
		this.titleName = titleName;
		this.alarmAnim = alarmAnim;
		this.backGround = R.drawable.background_cf;
	}
	
	public Form(int mainPic, int alarmMusic, int clickSound, int titleImg,
			String titleName, int alarmAnim,int background) {
		super();
		this.mainPic = mainPic;
		this.alarmMusic = alarmMusic;
		this.clickSound = clickSound;
		this.titleImg = titleImg;
		this.titleName = titleName;
		this.alarmAnim = alarmAnim;
		this.backGround = background;
	}

	public static Form getForm(int form) {
		Log.e("aaaaaaaaa", "getForm:"+form);
		if(form>=0&&form<formCount){
			return mForm[form];
		}else{
			return null;
		}
	}

	public void playClickSound() {
		if (clickSound != 0) {
			Media.getInstance(null).playSound(clickSound);
		}
	}

	public static void inialize(Context c) {
		inialSound( c);
		mForm = new Form[formCount];
		mForm[FORM_FIRST] = new Form(R.drawable.buttonx_lizi_tl, 
				R.raw.ptest, R.raw.beep, R.drawable.pgmain_lizi_title, "贞子 Dan",
				R.drawable.of_native_loader_progress);
		mForm[FORM_SECOND] = new Form(R.drawable.buttonx_lizi_tl, 
				R.raw.kame2002, R.raw.beep, R.drawable.cloud, "娜儿",
				R.drawable.of_native_loader_progress,R.drawable.pgbgnao);
		mForm[FORM_3RD] = new Form(R.drawable.buttonx_lizi_tl, 
				R.raw.ptest, R.raw.beep, R.drawable.cloud, "闹钟娘三号",
				R.drawable.of_native_loader_progress);
		mForm[FORM_4TH] =  new Form(R.drawable.buttonx_lizi_tl, 
				R.raw.ptest, R.raw.beep, R.drawable.cloud, "自定义",
				R.drawable.of_native_loader_progress);
	}

	static final int formCount = 4;
	public static final int FORM_NONE = -1;
	public static final int FORM_FIRST = 0;
	public static final int FORM_SECOND = 1;
	public static int FORM_3RD = 2;
	public static int FORM_4TH = 3;

}
